var demo01_A01IMG = document.querySelector('#demo01_IMG');
// var demo01_TEXIAO = document.querySelector('#TE_XIAO_ID');//获取特效
var demo01_DianChi = document.querySelector('#demo01_dianchi');//获取电池
var demo01_DianXian = document.querySelector('#demo01_SpanID');//获取电线
var demo01_INPUTShanShuo = document.querySelector('#demo01_DIVShanShuo');//获取INPUT闪烁
var demo01_MUSIC = document.querySelector('#demo01_MUSIC');//获取匿名音乐
var demo01_KEYPIC = document.querySelector('#demo01_KEY');//获取答案图标
var demo01_KEYPIC_SPAN = document.querySelector('#demo01_SPAM_ANSWER');//获取答案span
var demo01_INPUT_VALUE = document.querySelectorAll('.demo01_INPUT_01');//获取INPUT数组
// var demo01_CHECK_PIC = document.querySelector('#Check');//获取检查图标
var demo01_DAO_JI_SHI = document.querySelector('#demo01_DAO_JI_TIME');//获取整个倒计时DIV
var demo01_TIME_INPUT = document.querySelector('#demo01_TIME_INPUT');//获取倒计时的input
var demo01_Sec = document.querySelector('#SAN_JIAOXING');//获取三角形
var demo01_Sec_FU = document.querySelector('#demo01_Sec');//获取被激活盒子
var demo01_A01DEFINE_A = 0;
var demo01_A01DEFINE_B = 0;
var demo01_A01DEFINE_C = 0;
var demo01_A01DEFINE_CC = 0;
var demo01_A01DEFINE_D = 0;
var demo01_A01DEFINE_E = 0;
var demo01_LIGHT_BOOLEAN = false;
var demo01_LIGHT_BOOLEANM = true;
var demo01_TIME;
var demo01_DianChi0;


demo01_DianChi.onclick = function () {//电池点击事件
    if (demo01_A01DEFINE_CC == demo01_A01DEFINE_C) {
        demo01_A01DEFINE_CC = demo01_A01DEFINE_CC + 1;
        if (demo01_A01DEFINE_B % 2 == 0) {
            demo01_LIGHT_BOOLEANM = true;
            setTimeout(demo01_Change_Time01, 1500);
            // demo01_DianChi.src = 'pc01/powerSS.jpg.png';++++
            demo01_DianXian.style.width = '40%';
            setTimeout(demo01_Dian_Xian_Color, 2000);
            setTimeout(demo01_YanShi, 2000);//链表头1
            setTimeout(demo01_INPUT_ShanShuo, 2000);
            demo01_MUSIC.play();
            demo01_LIGHT_BOOLEAN = true;
            demo01_KEYPIC.src = 'pc01/ys_High_light.png';
            setTimeout(demo01_Reset_0, 2000);
            var demo01_Check = setInterval(demo01_Check, 3000);
            setTimeout(demo01_time_15, 2000);
            console.log(demo01_LIGHT_BOOLEANM);

        }
        else {
            demo01_DianChi.src = 'pc01/powerS.jpg';
            demo01_DianXian.style.width = '0%';
            clearInterval(demo01_DianChi0);
            setTimeout(demo01_JieShu, 2000);
            demo01_LIGHT_BOOLEAN = false;
            demo01_KEYPIC_SPAN.style.width = '0%';
            demo01_KEYPIC.src = 'pc01/ys.png';
            demo01_LIGHT_BOOLEANM = false;
            clearInterval(demo01_Check);
            setTimeout(demo01_time_15, 20000);
            console.log(demo01_LIGHT_BOOLEANM);
            demo01_DAO_JI_SHI.style.display = "inline"; //开启
            demo01_TIME = setInterval(demo01_01_daojishi, 1000);
            setTimeout(demo01_XIAO_SHI, 20000);//20秒自动关闭

        }
        demo01_A01DEFINE_B = demo01_A01DEFINE_B + 1;
    }

}

//悬浮展示Sec
demo01_Sec.onclick = function () {
    if (demo01_A01DEFINE_E % 2 == 0) {
        demo01_Sec_FU.style.height = "18%";
        demo01_Sec.className = 'JJJ';
    } else {
        demo01_Sec_FU.style.height = "0%";
        demo01_Sec.className = 'JJJ_right';


    }
    demo01_A01DEFINE_E = demo01_A01DEFINE_E + 1;
}




//电线颜色变化
function demo01_Dian_Xian_Color() {
    demo01_DianXian.style.color = 'yellow';
}


//--------------------倒计时
var demo01_k = 19;
function demo01_01_daojishi() {
    demo01_TIME_INPUT.value = demo01_k;
    demo01_k = demo01_k - 1;
    if (demo01_k == 0) {
        demo01_k = 20;

    }
    if (demo01_k == -1) {
        demo01_k = 20;

    }
}

//-------------------------------倒计时自动消失模块
function demo01_XIAO_SHI() {
    demo01_DAO_JI_SHI.style.display = "none";
    clearInterval(demo01_TIME);
}

// ----------------------------------
demo01_KEYPIC.onclick = function () { //答案点击事件
    if (demo01_LIGHT_BOOLEAN) {
        if (demo01_A01DEFINE_D % 2 == 0) {
            demo01_KEYPIC_SPAN.style.width = '50%';
            demo01_KEYPIC.src = 'pc01/ys_High_light.png';
        }
        else {
            demo01_KEYPIC_SPAN.style.width = '0%';
            demo01_KEYPIC.src = 'pc01/ys_CHONG.png';
        }
        demo01_A01DEFINE_D = demo01_A01DEFINE_D + 1;
    }
}

// ------------------------------------
// =---------------------------------------
function demo01_A01Twinkle() {
    demo01_A01IMG.src = 'pc01/DP.jpg';
    setTimeout(demo01_A02Twinkle, 50);
}
function demo01_A02Twinkle() {
    demo01_A01IMG.src = 'pc01/DPS.jpg';
    setTimeout(demo01_A03Twinkle, 150);
}
function demo01_A03Twinkle() {
    demo01_A01IMG.src = 'pc01/DP.jpg';
    setTimeout(demo01_A04Twinkle, 30);
}
function demo01_A04Twinkle() {
    demo01_A01IMG.src = 'pc01/DPS.jpg';
    setTimeout(demo01_A05Twinkle, 30);
}
function demo01_A05Twinkle() {
    demo01_A01IMG.src = 'pc01/DP.jpg';
    setTimeout(demo01_A06Twinkle, 30);
}
function demo01_A06Twinkle() {
    demo01_A01IMG.src = 'pc01/DPS.jpg';
    setTimeout(demo01_A07Twinkle, 30);
}
function demo01_A07Twinkle() {
    demo01_A01IMG.src = 'pc01/DPS.jpg';
    setTimeout(demo01_A08Twinkle, 3000);
}
function demo01_A08Twinkle() {
    demo01_A01IMG.src = 'pc01/DP.jpg';

}
function demo01_YanShi() {
    demo01_A01Twinkle();
    demo01_DianChi0 = setInterval(demo01_A01Twinkle, 3270);
    // console.log(123);
}


function demo01_time_15() {
    demo01_A01DEFINE_CC = demo01_A01DEFINE_C;
}

function demo01_JieShu() {
    demo01_A01IMG.src = 'pc01/DP.jpg';
    demo01_INPUTShanShuo.style.display = 'none';

}

//-------------------------

function demo01_INPUT_ShanShuo() {
    demo01_INPUTShanShuo.style.display = 'inline';
    setTimeout(demo01_INPUT_ShanShuo_A02, 50);
}
function demo01_INPUT_ShanShuo_A02() {
    demo01_INPUTShanShuo.style.display = 'none';
    setTimeout(demo01_INPUT_ShanShuo_A03, 150);
}
function demo01_INPUT_ShanShuo_A03() {
    demo01_INPUTShanShuo.style.display = 'inline';
    setTimeout(demo01_INPUT_ShanShuo_A04, 30);
}
function demo01_INPUT_ShanShuo_A04() {
    demo01_INPUTShanShuo.style.display = 'none';
    setTimeout(demo01_INPUT_ShanShuo_A05, 30);
}
function demo01_INPUT_ShanShuo_A05() {
    demo01_INPUTShanShuo.style.display = 'inline';
    setTimeout(demo01_INPUT_ShanShuo_A06, 30);
}
function demo01_INPUT_ShanShuo_A06() {
    demo01_INPUTShanShuo.style.display = 'none';
    setTimeout(demo01_INPUT_ShanShuo_A07, 30);
}
function demo01_INPUT_ShanShuo_A07() {
    demo01_INPUTShanShuo.style.display = 'inline';
    setTimeout(demo01_INPUT_ShanShuo_A08, 30);
}
function demo01_INPUT_ShanShuo_A08() {
    demo01_INPUTShanShuo.style.display = 'none';
    setTimeout(demo01_INPUT_ShanShuo_A09, 30);
}
function demo01_INPUT_ShanShuo_A09() {
    demo01_INPUTShanShuo.style.display = 'inline';
    setTimeout(demo01_INPUT_ShanShuo_A10, 30);
}
function demo01_INPUT_ShanShuo_A10() {
    demo01_INPUTShanShuo.style.display = 'none';
    setTimeout(demo01_INPUT_ShanShuo_A11, 500);
}
function demo01_INPUT_ShanShuo_A11() {
    demo01_INPUTShanShuo.style.display = 'inline';
    setTimeout(demo01_INPUT_ShanShuo_A12, 500);
}
function demo01_INPUT_ShanShuo_A12() {
    demo01_INPUTShanShuo.style.display = 'none';
    setTimeout(demo01_INPUT_ShanShuo_A13, 200);
}
function demo01_INPUT_ShanShuo_A13() {
    demo01_INPUTShanShuo.style.display = 'inline';
    // setTimeout(demo01_INPUT_ShanShuo_A13, 100);
}
// ------------------------------------------
function demo01_Reset_0() {
    demo01_KEYPIC.src = 'pc01/ys_CHONG.png';
}
//-----------------------------------------切换电池图标模块
var X = 8.33;
var sum = 100;
function demo01_Change_Time01() {
    sum = 100;
    demo01_DianChi.src = 'pc01/powerS_100.jpg';
    if (demo01_LIGHT_BOOLEANM) {
        setTimeout(demo01_Change_Time02, 15000); console.log("还剩" + (sum) + "电量");
    }
}
function demo01_Change_Time02() {
    sum = sum - X;

    if (demo01_LIGHT_BOOLEANM) {
        demo01_DianChi.src = 'pc01/powerS_90.jpg'; setTimeout(demo01_Change_Time03, 15000); console.log("还剩" + (sum) + "电量");
    }
}

function demo01_Change_Time03() {
    sum = sum - X;

    if (demo01_LIGHT_BOOLEANM) {
        demo01_DianChi.src = 'pc01/powerS_80.jpg';
        setTimeout(demo01_Change_Time04, 15000); console.log("还剩" + (sum) + "电量");
    }
}
function demo01_Change_Time04() {
    sum = sum - X;

    if (demo01_LIGHT_BOOLEANM) { demo01_DianChi.src = 'pc01/powerS_70.jpg'; setTimeout(demo01_Change_Time05, 15000); console.log("还剩" + (sum) + "电量"); }
}

function demo01_Change_Time05() {
    sum = sum - X;

    if (demo01_LIGHT_BOOLEANM) { demo01_DianChi.src = 'pc01/powerS_60.jpg'; setTimeout(demo01_Change_Time06, 15000); console.log("还剩" + (sum) + "电量"); }
}

function demo01_Change_Time06() {
    sum = sum - X;

    if (demo01_LIGHT_BOOLEANM) { demo01_DianChi.src = 'pc01/powerS_50.jpg'; setTimeout(demo01_Change_Time07, 15000); console.log("还剩" + (sum) + "电量"); }
}
function demo01_Change_Time07() {
    sum = sum - X;

    if (demo01_LIGHT_BOOLEANM) { demo01_DianChi.src = 'pc01/powerS_40.jpg'; setTimeout(demo01_Change_Time08, 15000); console.log("还剩" + (sum) + "电量"); }
}
function demo01_Change_Time08() {
    sum = sum - X;

    if (demo01_LIGHT_BOOLEANM) { demo01_DianChi.src = 'pc01/powerS_30.jpg'; setTimeout(demo01_Change_Time09, 15000); console.log("还剩" + (sum) + "电量"); }
}
function demo01_Change_Time09() {
    sum = sum - X;

    if (demo01_LIGHT_BOOLEANM) { demo01_DianChi.src = 'pc01/powerS_20.jpg'; setTimeout(demo01_Change_Time10, 15000); console.log("还剩" + (sum) + "电量"); }
}
function demo01_Change_Time10() {
    sum = sum - X;

    if (demo01_LIGHT_BOOLEANM) { demo01_DianChi.src = 'pc01/power_10.png'; setTimeout(demo01_Change_Time11, 15000); console.log("还剩" + (sum) + "电量"); }
}
function demo01_Change_Time11() {
    sum = sum - X;

    if (demo01_LIGHT_BOOLEANM) { demo01_DianChi.src = 'pc01/power_5.png'; setTimeout(demo01_Change_Time12, 15000); console.log("还剩" + (sum) + "电量"); }
}
function demo01_Change_Time12() {
    sum = sum - X;

    if (demo01_LIGHT_BOOLEANM) { demo01_DianChi.src = 'pc01/power_3.png'; setTimeout(demo01_Change_Time13, 15000); console.log("还剩" + (sum) + "电量"); }
}
function demo01_Change_Time13() {
    demo01_A01DEFINE_CC = demo01_A01DEFINE_C;
    sum = sum - X;
    demo01_DianChi.src = 'pc01/powerS.jpg';
    demo01_DianXian.style.width = '0%';
    clearInterval(demo01_DianChi0);
    setTimeout(demo01_JieShu, 2000);
    demo01_LIGHT_BOOLEAN = false;
    demo01_KEYPIC_SPAN.style.width = '0%';
    demo01_KEYPIC.src = 'pc01/ys.png';
    demo01_LIGHT_BOOLEANM = false;
    console.log('结束');
    demo01_A01DEFINE_B = demo01_A01DEFINE_B + 1;
}

















